﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Control.Bus;

namespace QuanLyKho
{
    public partial class FrmXuatBO : Form
    {
        DateTime Date;
        BusStaff Staff;
        public FrmXuatBO()
        {
            InitializeComponent();
        }
        public FrmXuatBO(DateTime _Date,BusStaff _staff)
        {
            InitializeComponent();
            Date = _Date;
            Staff = _staff;

        }
        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox2.Text != "")
            {
                BusExportBill Bill = new BusExportBill()
                {
                    ID = -1,
                    Date = this.Date,
                    Staff = this.Staff,
                    BillName = textBox1.Text,
                    BillCode = textBox2.Text
                };
                Bill.Insert();
                FrmExport frm = new FrmExport(Bill, this.Staff);
                
                this.Close();
                frm.Show();
            }
            else
            {
                label3.Text = " X ";
            }
        }

        private void FrmXuatBO_Load(object sender, EventArgs e)
        {

        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
